#切片赋值 ,将=后面可迭代元素的每一个元素，迭代出来，用来填充原列表被切出来的位置
L = [1,2,3]
L[0:2] = ["hello"]# ['hello', 3]

L = [1,2,3]
L[0:2] = "hello"
#["h","e","l","l","o",3]

L = [1,2,3,4,5,6]
L[-3:-1] = ["hello"]#[1,2,3,"hello",6]

L = [3,4,6]#变成[1,2,3,4,5,6,7,8,9]
L[0:0] = [1,2] #[1,2,3,4,6]
L[4:4] = [5]#[1,2,3,4,5,6]
L[6:6] = [7,8,9]



L = list(range(1,10))#[1,2,3,4,5,6,7,8,9]
#L[0:10:2] = "hello"
#当步长不是2或以上的时候，切出来的若刚个段落，赋值的可迭代元素的元素个数要和段数保持一致
#L[0:10:2] = ["hello","a","a","a","a","A"]

str = "abcdefg"
print(str[0:2])#"ab"
print(str)

str[0:2] = "aaa"

